RPC server is unavailable error no= | 您所在的位置:网站首页 › rpc service error › RPC server is unavailable error no= |
I have written a script which will get the local WIN NT users name from the remote computer. But i am get RPC server is unavailable error no=-2147023174 problem. Here is my script. On Error Resume Next strComputer = "192.120.131.111" //U r IP address here Set objSWbemLocator = CreateObject("WbemScripting.SWbemLocator") if err 0 then ' Check for errorcreating object: " & err.description wscript.echo "Error creating object: " & err.description wscript.quit end if set objfirewall = createobject("hnetcfg.fwmgr") set objpolicy = objfirewall.localpolicy.currentprofile set objadminsettings = objpolicy.remoteadminsettings objadminsettings.enabled = true Set objSWbemServices = objSWbemLocator.ConnectServer(strComputer, "root\cimv2", "domain\username", "pwd") if err 0 then ' Check for error wscript.echo "Error connecting to specified computer: " & err.description wscript.quit end if objSWbemServices.Security_.ImpersonationLevel = 3 WScript.Echo WScript.Echo "====================================" WScript.Echo "Computer: "& strComputer WScript.Echo "====================================" Set objWMIService = GetObject("winmgmts:\\" _ & strComputer& "\root\CIMV2") if err 0 then ' Check for error wscript.echo "Error connecting to WMI on specified computer: " & err.description wscript.quit end if Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_UserAccount") if err 0 then ' Check for error wscript.echo "Error executing query: " & err.description wscript.quit end if For Each objItem in colItems Wscript.Echo "-----------------------------------" Wscript.Echo "Win32_UserAccount instance" Wscript.Echo "-----------------------------------" Wscript.Echo "Name: "& objItem.Name Next I am running with administrator rights. Any help??? |
CopyRight 2018-2019 实验室设备网 版权所有 |